package tool.plot

import java.io.File
import implicits.Implicits._
import shared.Pojo._
import tool.Pojo._
import tool.Tool
import tool.plot.AllPlot.RPlotB


/**
 * Created by yz on 27/9/2020
 */
object ClassCountPie extends ClassCountPieT with RPlotB {

  def producePlotConfigFile(data: AllPlotData, workspaceDir: File, extraData: ExtraDataData) = {
    Tool.dataCoverConfigFile(data, workspaceDir, configFileName, configJsonFileName)
  }

  override def getCommand(data:AllPlotData,extraData: ExtraDataData): String = {
    s"""
       |${Tool.rScript} ${new File(Tool.rPath, "super_class_count_pie_plot.R").unixPath} --pc ${configFileName}
       |convert  -density 300 Class_Count_Pieplot.pdf  Class_Count_Pieplot.png
       |""".stripMargin
  }

  override def defaultPlotArg(tmpPlotData: AllPlotData): AllPlotData = {
    tmpPlotData.copy(
      layout = tmpPlotData.layout.copy(
        width = "0",
        height = "5",
      ),
      mainTitle = "",
    )
  }

}

